﻿using Md.Api.Entity.DapperModels.MdDB;
using Md.Api.Model.Manage.SysUser.Request;
using Md.Dapper.Repositories.Md;

namespace Md.Api.Service.Manage.SysUser;
/// <summary>
/// 分页获取系统用户服务
/// </summary>
public class GetSysUserPageListService : ApiBase<RequestGetSysUserPageListModel>
{
    /// <summary>
    /// 系统用户仓储
    /// </summary>
    public SysUserRep sysUserRep { get; set; }
    /// <summary>
    /// 执行
    /// </summary>
    protected override void ExecuteMethod()
    {
        var model = new SysUserModel();

        model.DeptId = Parameter.DeptId;
        model.UserName = Parameter.UserName;
        model.NickName = Parameter.NickName;
        model.UserType = Parameter.UserType;
        model.Email = Parameter.Email;
        model.Phonenumber = Parameter.Phonenumber;
        model.Sex = Parameter.Sex;
        model.Status = Parameter.Status;
        model.CreateBy = Parameter.CreateBy;
        model.UpdateBy = Parameter.UpdateBy;

        var res = sysUserRep.GetSysUserPageList(model, Parameter.PageIndex, Parameter.PageSize, Parameter.OrderBy, Parameter.IsDesc);

        Result.Data = res;
    }
}

